package com.youlai.boot.system.service.impl;


import com.alibaba.excel.util.StringUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.EquipmentMapper;
import com.youlai.boot.system.model.QB.Equipment;
import com.youlai.boot.system.service.EquipmentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper,Equipment>  implements EquipmentService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private  EquipmentMapper equipmentMapper;
    @Override
    public boolean saveequipment(Equipment equipment) {
        equipment.setAddtime(LocalDateTime.now());
        return save(equipment);
    }

    @Override
    public List<Equipment> getAllEquipment() {
        return equipmentMapper.selectList(null);
    }

    @Override
    public boolean deletEquipmentById(Integer id) {
        return baseMapper.deleteById(id)>0;
    }
}
